<template>

 <div>
 <div id="main" style="height: 300px;width: 400px;"></div>
</div>

</template>


<script>
import * as echarts from 'echarts';

export default {
  name:"tubing",
  mounted() {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'))
      fetch("http://127.0.0.1:5000/getPlaneRequire").then((e)=> {
        return e.json()
      }).then((e)=>{
        myChart.setOption(
            {
    title: {
    text: 'Referer of a Website',
    subtext: 'Fake Data',
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: '本科' },
        { value: 735, name: '大专' },
        { value: 580, name: '中专' },
        { value: 484, name: '研究生' },
        { value: 300, name: '博士' }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
    }
        )
      })
    // 绘制图表
    myChart.setOption({
    title: {
    text: '学历分部图',
    subtext: 'Fake Data',
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: '本科' },
        { value: 735, name: '大专' },
        { value: 580, name: '中专' },
        { value: 484, name: '研究生' },
        { value: 300, name: '博士' }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
    });
  }
}
</script>

<style>

</style>

